//	var aid;
//	var cid;
$(function(){
	
//	var aid;
//	var cid;
	
	//1.解析url,获取aid
	//http://10.25.41.3:8066/wechatvote/baoming.html?aid=1&cid=2&bid=2&did=2
	//截取?后面的内容
	var index = location.href.lastIndexOf("?");//字符串中，最后一个问号的位置
	var params = location.href.substr(index+1);//params='aid=1&cid=2&bid=2&did=2'
	
	//2.按照&分割
	var arr = params.split("&");
	//遍历数组
	for(var i=0;i<arr.length;i++){
		//if,为了找到aid
		if(arr[i].startsWith("aid")){
			var index = arr[i].lastIndexOf("=");//aid=1
			aid = arr[i].substr(index+1);
		}
		
		if(arr[i].startsWith("cid")){
			var index = arr[i].lastIndexOf("=");//cid=1
			cid = arr[i].substr(index+1);
		}
	}
	
	$("#menu_home").click(function(){
		location.href = "index.html?aid="+aid;
	});
	
	$("#menu_baoming").click(function(){
		location.href = "baoming.html?aid="+aid;
	});
	
	$("#menu_prize").click(function(){
		location.href = "prize.html?aid="+aid;
	});
	
	$("#menu_rank").click(function(){
		location.href = "rank.html?aid="+aid;
	});
})